<template>
  <div class="detailShopper" v-if="shopperInfo && Object.keys(shopperInfo).length >= 1">
    <div class="detailPadding">
      <div class="detailPaddingTop">
        <img :src="shopperInfo.shopLogo" alt="">
        <div>{{shopperInfo.name}}</div>
      </div>
      <div class="detailPaddingBottom">
        <div class="detailPaddingBottomLeft">
          <div class="detailVolume">
            <div class="detailNumber">{{shopperInfo.sells}}</div>
            <div class="detailGross">总销量</div>
          </div>
          <div class="detailQuantity">
            <div class="detailNumber">{{shopperInfo.cGoods}}</div>
            <div class="detailGross">全部宝贝</div>
          </div>
        </div>
        <div class="detailPaddingBottomRight">
          <div class="detailPaddingBottomRightCenter" >
            <div class="detailDescribe" v-for="item in shopperInfo.score">
              <p class="detailDescribeName">{{item.name}}</p>
              <p class="detailDescribeNumber" :class="{isColorRed: item.score >= 5,isColorGreen : item.score < 5}">{{item.score}}</p>
              <p class="detailDescribeLow" :class="{isBackColorRed: item.isBetter}">{{item.isBetter | isBetter}}</p>
            </div>
          </div>
        </div>
      </div>
      <div class="detailPaddingBtn">
        <button>进店逛逛</button>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "DetailShopper",
    data(){
      return {
      };
    },
    props: {
      shopperInfo: {
        type: Object,
        default(){
          return {};
        }
      }
    },
    filters: {
      isBetter(val){
        return val ? '高' : '低';
      }
    }
  }
</script>

<style scoped>
  .detailShopper{
    margin-top: 10px;
    padding: 20px 5px;
    background-color: white;
  }
  .detailPadding .detailPaddingTop{
    display: flex;
    align-items: center;
  }
  .detailPadding .detailPaddingTop img {
    width: 60px;
    height: 60px;
    border: 1px solid #999;
    border-radius: 50%;
    margin-right: 10px;
  }
  .detailPadding .detailPaddingBottom{
    display: flex;
  }
  .detailPadding .detailPaddingBottom .detailPaddingBottomLeft{
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 50%;
    border-right: 1px solid #e6e6e6;
  }
  .detailPadding .detailPaddingBottom .detailPaddingBottomLeft .detailGross{
    font-size: 12px;
    text-align: center;
  }
  .detailPadding .detailPaddingBottom .detailPaddingBottomLeft .detailNumber{
    font-size: 18px;
    text-align: center;
  }
  .detailPadding .detailPaddingBottom .detailPaddingBottomRight{
    width: 50%;
    font-size: 13px;
  }
  .detailPadding .detailPaddingBottom .detailPaddingBottomRight .detailPaddingBottomRightCenter{
    max-width: 120px;
    width: 100%;
    margin: auto;
    padding: 10px 0;
  }
  .detailPadding .detailPaddingBottom .detailPaddingBottomRight .detailDescribe{
    padding: 5px 0;
    display: flex;
  }
  .detailPadding .detailPaddingBottom .detailPaddingBottomRight .detailDescribeName{
    max-width: 70px;
    width: 100%;
  }
  .detailPadding .detailPaddingBottom .detailPaddingBottomRight .detailDescribeNumber{
    max-width: 40px;
    width: 100%;
  }
  .detailPadding .detailPaddingBottom .detailPaddingBottomRight .detailDescribeLow{
    text-align: right;
    background-color: #5ea732;
    color: white;
  }
  .detailPadding .detailPaddingBtn{
    text-align: center;
    margin-top: 10px;
  }
  .detailPadding .detailPaddingBtn button {
    outline: none;
    font-size: 14px;
    background-color: #f2f5f8;
    border-radius: 5px;
    padding: 5px 40px;
    border: none;
    color: var(--color-text);
  }
  .isColorRed{
    color: red;
  }
  .isColorGreen{
    color: #5ea732;
  }
  .isBackColorRed{
    background-color: red !important;
  }
</style>